import {
    request
} from "@/api/request.js"

const BASE_URL = 'https://ai-api.ytaiccg.com/api/order';
// const BASE_URL = 'https://ai-api.banjiajia.com/api/order';

//获取充值套餐列表
/**
 * @constructor
 */
const apiGetGoods = (data = {}) => {
    return request({
        url: BASE_URL + "/goods/view",
        data
    })
}

//获取订单记录
/**
 * @constructor
 * @param {pageParams} pageParams - pageNo-页码 | pageSize-每页记录数
 */
const apiGetOrderRecords = (data = {}) => {
    return request({
        url: BASE_URL + "/record/my/recharge",
        data,
        method: "POST"
    })
}

//费用查询
/**
 * @constructor
 */
const apiGetCostCheck = (data = {}) => {
    return request({
        url: BASE_URL + "/fee/check?kind=" + data.kind + '&mode=' + data.mode,
    })
}

//微信内部浏览器支付
/**
 * @constructor
 */
const apiGetwechatBrowserPay = (data = {}) => {
    return request({
        url: BASE_URL + "/wxPay/unifiedOrder/jsapi/" + data.goodsId,
        data,
    })
}


//微信外部浏览器支付
/**
 * @constructor
 */
const apiGetOutSideBrowserPay = (data = {}) => {
    return request({
        url: BASE_URL + "/wxPay/unifiedOrder/h5/" + data.goodsId
    })
}

//获取支付状态
/**
 * @constructor
 */
const apiGetPaymentStatus = (data = {}) => {
    return request({
        url: BASE_URL + "/pay/status/" + data.id
    })
}



export {
    apiGetGoods,                    //获取充值套餐列表
    apiGetOrderRecords,              //获取订单记录
    apiGetCostCheck,                  //费用查询
    apiGetwechatBrowserPay,         //微信内部浏览器支付
	apiGetOutSideBrowserPay,         //微信外部浏览器支付
	apiGetPaymentStatus         //获取支付状态
}   